/*!
// Testweb v0.4.0
// http://or-change.cn
// Copyright 2014 OrChange Inc. All rights reserved.
// Licensed under the GPL License.
*/
define(function (require, exports, module) {
	'use strict';
	var helper = require("model/helper"),
		jQuery = require("lib/jquery/jquery");
	exports.execute = function (me, $, load) {
		return function () {
			helper.moveToCenter(me);
			helper.initWindowTemplate(me);
			helper.component($(this).get(0));

			$("#cancel").click(function () {
				load.tpm.close(me, {});
			});

			$("#create_pattern_dict").click(function () {
				load.tpm.open("dictionary_pattern", {});
			});

			$("#local [data-pid]").click(function () {
				var index = $(this).attr("data-pid");
				load.tpm.refresh("process", {
					dictionary: "local:" + index
				}).close(me);
			});
		};
	};
});